package org.example.forum.TestController;

import org.example.forum.exception.ApplicationException;
import org.springframework.web.bind.annotation.GetMapping;

import org.springframework.web.bind.annotation.Mapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@ResponseBody
@RequestMapping("/test")
public class Test {
    @GetMapping("/exception")
    public String testException() throws Exception {
        throw new Exception(" 这是⼀个 Exception");
    }
    @GetMapping("/appException")
    public String testApplicationException() {
        throw new ApplicationException(" 这是⼀个⾃定义的 ApplicationException");
    }
}
